package com.weibo.hibernate;
//abcdefghijk  wyf

import java.util.Iterator;
import java.util.List;

import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.cfg.Configuration;

import com.weibo.domain.*;

public class TestBasicInfo {

	/**
	 * @param args
	 */
	public static void main(String[] args) {

		Session session = null;
		Configuration config=null;
		SessionFactory factory = null;
		Transaction tran=null;

		config = new Configuration().configure();
		factory = config.buildSessionFactory();
		session = factory.openSession();

//		BasicInfo b=new BasicInfo();
//		b.setLoginId("87654321");
//		b.setUserId("123");
//		b.setUserName("guang");
//		b.setUserPwd("999999");
//		tran = session.beginTransaction();
//		session.saveOrUpdate(b);
//		tran.commit();
		
		BasicInfo b=(BasicInfo)session.get(BasicInfo.class, "1234");
		if(b!=null)System.out.println(b.getUserPwd());
		else System.out.println("b.getUserPwd() not found");
	}

}
